import { PROFILE_PROFILE, PROFILE_USER } from '../action_types'

const initialValues = {
  user: {},
  userProfile: {},
}
export const profile = (state = initialValues, action) => {
  const { type, payload } = action
  if (type === PROFILE_USER) {
    return {
      ...state,
      user: payload,
    }
  }
  if (type === PROFILE_PROFILE) {
    return {
      ...state,
      userProfile: payload,
    }
  }
  return state
}
